const Home = () => import('@/views/Home')
const Footer = () => import('@/components/Footer')
const Login = () => import('@/views/Login')
const Mine = () => import('@/views/Mine')
const Order = () => import('@/views/Order')
const Shop = () => import('@/views/Shop')
const Search = () => import('@/views/Search')
const Header = () => import('@/components/Header')
const Detial = () => import('@/views/Detial')
const Goods = () => import('@/views/Detial/Goods')
const Ratings = () => import('@/views/Detial/Ratings')
const Info = () => import('@/views/Detial/Info')

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    components: {
      header: Header,
      default: Home,
      footer: Footer
    },
    meta: {
      title: '外卖',
      icon: '&#xe8c6;',
      isTab: true
    }
  },
  {
    path: '/search',
    components: {
      header: Header,
      default: Search,
      footer: Footer
    },
    meta: {
      title: '搜索',
      icon: '&#xe60c;',
      isTab: true
    }
  },
  {
    path: '/order',
    components: {
      header: Header,
      default: Order,
      footer: Footer
    },
    meta: {
      title: '订单',
      icon: '&#xe63a;',
      isTab: true
    }
  },
  {
    path: '/mine',
    components: {
      header: Header,
      default: Mine,
      footer: Footer
    },
    meta: {
      title: '我的',
      icon: '&#xe620;',
      isTab: true
    }
  },
  {
    path: '/login',
    name: 'login',
    components: {
      header: Header,
      default: Login
    }
  },
  {
    path: '/shop',
    component: Shop
  },
  {
    path: '/detial',
    components: {
      default: Detial
    },
    meta: {
      title: '商铺详情'
    },
    children: [
      {
        path: 'goods',
        component: Goods
      },
      {
        path: 'ratings',
        component: Ratings
      },
      {
        path: 'info',
        component: Info
      },
      {
        path: '',
        redirect: 'goods'
      }
    ]
  }
]

export default routes
